package com.ybbase.framework.mapper.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ybbase.framework.config.mybatisplus.DataPermission;
import com.ybbase.framework.model.po.system.Dict;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 数字字典表 Mapper 接口
 * </p>
 *
 * @author cg
 * @since 2019-11-25
 */
public interface DictMapper extends BaseMapper<Dict> {

    /**
     * 获取二级树
     *
     * @return
     */
    List<Dict> getTree();

    /**
     * 根据parent_id查找分页数据
     *
     * @return
     */
    @DataPermission(dataMethod = "findByParentId")
    IPage<Dict> findByParentId(IPage<Dict> page, QueryWrapper<Dict> queryWrapper, Integer parentId);

}
